package movie;

import java.util.LinkedList;

public class Movie {

	private String name;
	private int year;
	private String urlinfo;
	private double rate;
	private LinkedList<Torrent> torrentList;
	private String poster;
	private boolean downloaded=false;

	public boolean isDownloaded() {
		return downloaded;
	}

	public void setDownloaded(boolean downloaded) {
		this.downloaded = downloaded;
	}

	public String getPoster() {
		return poster;
	}

	public Movie(String name, String year, String urlToGetTorrents) {

		this.name = name;
		this.year = Integer.parseInt(year);
		this.urlinfo = urlToGetTorrents;
	}

	public Movie(String name, int year, String poster) {
		this.name=name;
		this.year=year;
		this.poster="";//TODO ARRANJAR O POSTER!
	}

	public LinkedList<Torrent> getTorrentList() {
		return torrentList;
	}

	public void setTorrentList(LinkedList<Torrent> torrentList) {
		this.torrentList = torrentList;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public String getURL() {
		return urlinfo;
	}

	public void setURL(String uRL) {
		urlinfo = uRL;
	}

	public double getRate() {
		return rate;
	}

	public void setRate(String string) {
		String [] a=string.split(":");
		a=a[1].split("/");
		this.rate = Double.parseDouble(a[0]);
	}


	public String text() {
		return "Name:" + name + "  " + "Number Of Torrents:" + torrentList.size() + "  "
				+ "Year:" + year + "  " + "Rate:" + rate;
	}

	public void setPoster(String image) {
		this.poster=image;
		
	}



}
